<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script src="../dev/vendors/vue.js"></script>
  <div id="app">
    <ul id="example-1">
      <li v-for="(value, key, index) in object">
        {{ index }}.{{ key }} : {{ value }}
      </li>
    </ul>
    <span v-for="n in 10">{{ n }}</span>
    <li v-for="n in even(numbers)">{{ n }}</li>
  </div>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        object: {
          firstName: 'John',
          lastName: 'Doe',
          age: 30
        },
          numbers: [ 1, 2, 3, 4, 5 ]
      },
      methods: {
        even: function (numbers) {
          return numbers.filter(function (number) {
            return number % 2 === 0
          })
        }
      },
      computed: {
        evenNumbers: function () {
          return this.numbers.filter(function (number) {
            return number % 2 === 0
          })
        }
      }
    })
  </script>
</body>
</html>